<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>a==1&&a==2&&a==3???</title>
</head>

<body>
    <script type="text/javascript">
        var a = {
            i: 1,
            valueOf: function () {
                if (this.i === 1) {
                    this.i++;
                    return 1;
                } else if (this.i === 2) {
                    this.i++;
                    return 2;
                } else {
                    return 3;
                }
            }
        }

        if (a == 1 && a == 2 && a == 3) {
            alert("是");
            console.log(a);
        }
    </script>
</body>

</html>